- /* sdfentcn.cpp by K.Tsuru */
- // function ID = 3500 DRADIX, BRADIX
- /***************************************************
- SDouble and SDecimal classes
- It provides the entry of a constant function.
- userV : given by user
- snV : pointer to the variable which sets the result, snV!=NULL
- pfDefFunc : pointer to the function which calculate the constant when
- the number of figures is insufficient
- maxSize : the number of calculated figures
- The function prototype is declared in "snfunc.h".
- ****************************************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
- static const char* func = "EntryConst";
-
- void EntryConst(const SDouble* userV, SDouble* snV,
- SDouble (*pfCalcFunc)(), uint* maxSize){
-
- //If there is no method to evaluate or "new" operator has not been used in the constant
- //function, it makes an error.
- if( (userV == NULL) && (pfCalcFunc == NULL) ) SNManager::SetError(SNManager::SYNTAX_ERR, func, 3500);
- if(snV == NULL) SNManager::SetError(SNManager::FATAL, func, 3500);
- uint max_sz = snV->MaxSize();
- uint snVSize = snV->Head() + 1u; // ver. 2.17 SDHead() --> Head()
- uint userSize = (userV != NULL) ? (userV->Head()+1u) : 0;
-
- if(snVSize < max_sz){
- if(userSize >= max_sz) *snV = *userV; //sufficient figures is given by "userV"
- else if(pfCalcFunc != NULL) *snV = (*pfCalcFunc)(); //calculation
- else snV->SetError(snV->SYNTAX_ERR, func, 3500); //no method to calculate
- }
- *maxSize = max_sz;
- }
sdfentcn.cpp : last modifiled at 2017/06/23 10:57:39(1,484 bytes)
created at 2017/10/07 10:22:50
The creation time of this html file is 2017/10/07 11:29:39 (Sat Oct 07 11:29:39 2017).